﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class info : System.Web.UI.Page
{
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString.ToString());
    static string infotype = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        infotype = Request.QueryString["id"].ToString();

        mf.DataSource = tb_info(infotype);
        mf.DataBind();

        sf.DataSource = tb_LeaguerInfo(infotype);
        sf.DataBind();

    }
    public DataSet tb_LeaguerInfo(string infotype)
    {
        string sql = "select top 20 * from payinfo where (type='" + infotype + "') and show=1 and showday >= GETDATE() order by date desc";
        SqlDataAdapter da = new SqlDataAdapter(sql, conn);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds;
    }
    public DataSet tb_info(string infotype)
    {
        string sql = "select * from info where type='" + infotype + "' and show=1 order by date desc";
        SqlDataAdapter da = new SqlDataAdapter(sql, conn);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds;
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {

        Session["sqlstr"] = "select * from payinfo where type='" + type.Text + "' and info like '%" + sinfo.Text + "%'";

        Response.Redirect("seach.aspx");
    }
}